var t = require;
var e = module;
var o = exports;
var a,
    i =
        (this && this.__extends) ||
        ((a = function (t, e) {
            return (a =
                Object.setPrototypeOf ||
                ({__proto__: []} instanceof Array &&
                    function (t, e) {
                        t.__proto__ = e;
                    }) ||
                function (t, e) {
                    for (var o in e) Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
                })(t, e);
        }),
        function (t, e) {
            a(t, e);
            function o() {
                this.constructor = t;
            }
            t.prototype = null === e ? Object.create(e) : ((o.prototype = e.prototype), new o());
        }),
    n =
        (this && this.__decorate) ||
        function (t, e, o, a) {
            var i,
                n = arguments.length,
                r = n < 3 ? e : null === a ? (a = Object.getOwnPropertyDescriptor(e, o)) : a;
            if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) r = Reflect.decorate(t, e, o, a);
            else
                for (var s = t.length - 1; s >= 0; s--)
                    (i = t[s]) && (r = (n < 3 ? i(r) : n > 3 ? i(e, o, r) : i(e, o)) || r);
            return n > 3 && r && Object.defineProperty(e, o, r), r;
        };
Object.defineProperty(o, "__esModule", {value: !0});
var r = t("UIBase"),
    s = t("ZuanshiRewardItem"),
    c = cc._decorator,
    p = c.ccclass,
    l =
        (c.property,
        c.menu,
        (function (t) {
            i(e, t);
            function e() {
                var e = (null !== t && t.apply(this, arguments)) || this;
                e.tag = "";
                e.allLevelData = [
                    {path: "Dynamic_Icon_Helper_01", isView: !0},
                    {path: "Dynamic_Icon_Helper_02", isView: !0},
                    {path: "Dynamic_Icon_Helper_03", isView: !0},
                    {path: "Dynamic_Icon_Helper_04", isView: !0},
                    {path: "Dynamic_Icon_Helper_05", isView: !0},
                    {path: "Dynamic_Icon_Helper_06", isView: !0}
                ];
                return e;
            }
            e.prototype.onShowEnd = function () {
                this._ListGrop.$ListGroupCom.setPutGetNode(
                    function () {
                        return QLooperNode.getNode(QLooperNode.tag_zuanShiInvateItem);
                    },
                    function (t) {
                        QLooperNode.putNode(t);
                    }
                );
                for (; this.allLevelData.length > 5; ) {
                    var t = Math.floor(Math.random() * this.allLevelData.length);
                    this.allLevelData.splice(t, 1);
                }
                EVUIEffView.on(EVUIEffView.clickRewardItem, this.clickItem.bind(this));
                this.updateView();
            };
            e.prototype.clickItem = function (t, e) {
                var o = this;
                if (this.allLevelData[e]) {
                    this.allLevelData.splice(e, 1);
                    EVUIEffView.emit(
                        EVUIEffView.moveZhuanShi,
                        this.node.convertToWorldSpaceAR(cc.Vec2.ZERO),
                        2,
                        "2",
                        "0"
                    );
                    this.scheduleOnce(function () {
                        o.updateView();
                    });
                }
            };
            e.prototype.updateView = function () {
                var t = this.allLevelData.length;
                this._ListGrop.$ListGroupCom.reSetBaseInfo(t, 0, this.setitemaction.bind(this));
                this._ListGrop.$ListGroupCom.updateAllItem();
            };
            e.prototype.setitemaction = function (t, e, o) {
                o || (o = {});
                if (!o.com) {
                    o.com = e.getComponent(s.default);
                    o.id = t;
                }
                var a = this.allLevelData[t];
                if (o.com && a && this.allLevelData[t].isView) {
                    e.active = !0;
                    var i = o.com;
                    i.tag = this.tag;
                    i.init(t, this.allLevelData[t].path);
                } else e.active = !1;
            };
            e.prototype.onCloseStart = function () {
                EVUIEffView.offTarget(this);
            };
            return n([p], e);
        })(r.default));
o.default = l;
